//package com.relax.guolv;
//
//import org.springframework.beans.factory.support.BeanDefinitionRegistry;
//import org.springframework.context.annotation.Condition;
//import org.springframework.context.annotation.ConditionContext;
//import org.springframework.core.env.Environment;
//import org.springframework.core.type.AnnotatedTypeMetadata;
//
//public class MyCondition  implements Condition {
//    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
//        Environment environment = context.getEnvironment();
//        String property = environment.getProperty("os.name");
//        System.out.println(property);
//        /**
//         * registry 获取判断容器里面是否含有某些bean
//         */
//        BeanDefinitionRegistry registry = context.getRegistry();
//        boolean person = registry.containsBeanDefinition("person");
//        if(property.contains("Windows")){
//            return true;
//        }
//        return false;
//    }
//}
